package com.ww.scala.syntax

import java.util

/**
 * match
 */
object syntax06_match {

  def main(args: Array[String]): Unit = {

    val tuple = (1.0, 88, "str",false)
    val iterator = tuple.productIterator
    val units = iterator.map(
      (x) => {
        x match {
          case y: Int => println(s"${y} is int")
          case 1 => println(s"$x is 1")
          case "str" => println(s"$x is str")
          case _ => println("不知道是个啥")
        }
      }
    )
    println("开始while")
    while(units.hasNext) println(units.next())
    println(println)

  }


}


